<%@ page language="java" import="java.util.*,com.ncp.model.entity.news.*,com.ncp.model.biz.news.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
ArrayList al1=new NewsManager().showNews();
int l1=al1.size();
%>
<div class="news">
	<div class="title">
		<p class="left">最新资讯</p>
		<p class="right"><a href="pages/news/newslist.jsp">更多>></a></p>
	</div>
	<div class="contain">
		<%
		if(l1>=3){
			for(int i=l1-1;i>l1-4;i--){
				NewsBean nb=(NewsBean)al1.get(i);  
				%>
				<div class="word_pic">
				<a class="demo" href="NewsClServlet?type=content&id=<%=nb.getId()%>">
					<img src="images/news/<%=nb.getPicture() %>" width="213" height="144"/>
				</a>
				<p class="explain"><a href="NewsClServlet?type=content&id=<%=nb.getId()%>"><%=nb.getTitle() %></a></p>
				</div>
				<%
			}
		}else{
			for(int i=l1-1;i>-1;i--){
				NewsBean nb=(NewsBean)al1.get(i);
				%>
				<div class="word_pic">
				<a class="demo" href="NewsClServlet?type=content&id=<%=nb.getId()%>">
					<img src="images/news/<%=nb.getPicture() %>" widht="213" height="144"/>
				</a>
				<p class="explain" style="white-space:nowrap; width:180px; overflow:hidden;"><a href="NewsClServlet?type=content&id=<%=nb.getId()%>"><%=nb.getTitle() %></a></p>
				</div>
				<%
			}
		}
		%>
		
	</div>
	<div style="clear:both"></div>
</div>
